package com.mcintyret.site.web.controller;

import com.mcintyret.site.context.UserContext;
import com.mcintyret.site.web.model.CommonModelElements;
import org.springframework.ui.Model;
import org.springframework.web.servlet.view.RedirectView;

import javax.annotation.Resource;

public abstract class BaseController {

    @Resource
    protected UserContext userContext;
    @Resource
    private CommonModelElements commonModelElements;

    protected void setupCommonElements(Model model) {
        commonModelElements.setupCommonElements(model);
    }

    protected RedirectView redirect(String url) {
        return new RedirectView(url, true, true, false);
    }

//    @ModelAttribute("origin")
//    public String setOrigin(@PathVariable("origin") String origin) {
//        return origin;
//    }

}